import request from '@/utils/request'

// 查询结算账号列表
export function listAccount(query) {
  return request({
    url: '/basicsystem/account/list',
    method: 'get',
    params: query
  })
}

// 查询结算账号列表 统计报表
export function reportaccountlist(query) {
  return request({
    url: '/basicsystem/account/reportaccountlist',
    method: 'get',
    params: query
  })
}

// 查询结算账号详细
export function getAccount(id) {
  return request({
    url: '/basicsystem/account/' + id,
    method: 'get'
  })
}

// 新增结算账号
export function addAccount(data) {
  return request({
    url: '/basicsystem/account',
    method: 'post',
    data: data
  })
}

// 修改结算账号
export function updateAccount(data) {
  return request({
    url: '/basicsystem/account',
    method: 'put',
    data: data
  })
}

// 删除结算账号
export function delAccount(id) {
  return request({
    url: '/basicsystem/account/' + id,
    method: 'delete'
  })
}

// 查询结算账号下拉框列表
export function getAccounts(query) {
  return request({
    url: '/basicsystem/account/selectlist',
    method: 'get',
    params: query
  })
}

// 设置默认结算账号
export function setDefaultAccount(id) {
  return request({
    url: '/basicsystem/account/setDefault/'+id,
    method: 'get'
  })
}

// 查询结算统计
export function getAccountStatistics(query) {
  return request({
    url: '/basicsystem/account/getAccountStatistics',
    method: 'get',
    params: query
  })
}


// 查询账户流水
export function findAccountInOutList(query) {
  return request({
    url: '/basicsystem/account/findAccountInOutList',
    method: 'get',
    params: query
  })
}

export function getAccountDetailByNumber(number) {
  return request({
    url: '/basicsystem/account/getDetailByNumber/' + number,
    method: 'get'
  })
}
